.TH E1432_SET_SAMPLE_MODE 3 E1432
.SH NAME
.nf
e1432_set_sample_mode \- Set method of resampling time data in order tracking
e1432_get_sample_mode \- Get method of resampling time data in order tracking
.fi
.IX e1432_set_sample_mode(3) 3
.IX e1432_get_sample_mode(3) 3
.SH SYNOPSIS
.cS
SHORTSIZ16 e1432_set_sample_mode(E1432ID hw, SHORTSIZ16 ID,
                               SHORTSIZ16 mode)
SHORTSIZ16 e1432_get_sample_mode(E1432ID hw, SHORTSIZ16 ID,
                               SHORTSIZ16 *mode)
.cE
.SH DESCRIPTION
\fIe1432_set_sample_mode\fR sets the method of resampling time data while
in order tracking to either the standard computed resampling or 
resampling at each tach pulse.  The latter method is useful when using
tachometers/encoders with multiple pulses per revolution.  This method
resamples the time data at every tach pulse as opposed to the normal 
resampling method which computes the resampling points based on the
delta order parameter and interpolated shaft positions.  


The resample mode is a "global" parameter.  It applies to an entire E1432/33
module (or group of modules if in a master/slave configuration) rather than 
to one of its channels.  The \fIID\fR parameter is
used only to identify which module the function applies to, and all
channels in that module will report the same value for this parameter.

\fIhw\fR must be the result of a successful call to
\fIe1432_assign_channel_numbers\fR, and specifies the group of
hardware to talk to.

\fIID\fR is either the ID of a group of channels that was obtained with a
call to \fIe1432_create_channel_group\fR, or the ID of a single channel.

\fImode\fR selects the resample mode.  The two modes
are \fBE1432_RESAMP_NORMAL\fR for the normal mode and \fBE1432_RESAMP_AT_TACH\fR
for the resample at tach times mode.

Resampling of time data only make sense in the order tracking
mode of the E1432, which means that the \fIe1432_set_calc_data\fR function
must be set to \fBE1432_DATA_RESAMP_TIME\fR or \fBE1432_DATA_ORDER\fR.
If it is set to \fBE1432_DATA_ORDER\fR, the blocksize must be a power of two.
The number of pulses per revolution as specified by the 
\fIe1432_set_tach_ppr\fR function is used to get the number of sampling points
per revolution in the resample at tach mode and the delta order parameter is
ignored.
The value of smoothing set by the \fIe1432_set_rpm_smoothing\fR function is
ignored when in the resample at tach mode.

In the resample at tach mode, the number of pulses per revolution must be 
set by the \fIe1432_set_tach_ppr\fR function.  The \fIblocksize\fR parameter 
is set by \fIe1432_set_blocksize\fR to a value equal to the number of pulses
per revolution times the number of revolutions of data wanted in a block. 
This number does not have to be a power of two \fBunless\fR the internal 
FFT calculation is enabled with the \fIe1432_set_calc_data\fR function.

Except for a special external trigger case mentioned below, the resample at 
tach mode ignores all arming and triggering modes.
The module will continuously resample time data at the tach pulse times
whenever the RPM is within the high and low values set by 
\fIe1432_set_rpm_high\fR and \fIe1432_set_rpm_low\fR respectively.  If this
causes the module to fall behind enough where new data coming into
the data FIFO overwrites old data, the module will skip over some of the 
older data and then continue resampling in order to keep up.  When it
does this, it will issue a warning, \fBWARN1432_LOST_DATA_SHIFTED_OUT_FIFO\fR.

There is a special configuration of the two tach channels such that one channel
can be used to start the resampling process, whose resample points come from
the other channel.  This is the external trigger option which allows each 
occurance of the resample at tach process to be initiated by a "top dead center"
signal once per revolution, for instance.  In this configuration, the first
tach channel must be configured as the resampling channel and the second as
the trigger channel.  An example of the code to do this is found in the demo
programs by uncommenting the \fBEXT_TRIG\fR define statement.

The demo programs, at_tach.c and at_tach2.c, show how to set up the module 
to do resample at tach.

.SH "RESET VALUE"
After a reset, \fImode\fR is set to \fBE1432_SAMP_RESAMP\fR.
.SH "RETURN VALUE"
Return 0 if successful, a (negative) error number otherwise.
.SH "SEE ALSO"
.na
e1432_set_calc_data, e1432_set_tach_ppr, e1432_get_meas_warning.
.ad
